Speed GPX writer by 19% by removing implicit time_t conversion in a test
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 12 Jul 2013 21:43:31 +0000 (21:43 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 12 Jul 2013 21:43:31 +0000 (21:43 +0000)
that I'm not convinced matters anyway.  ('exported' seems really weird.)

gpsbabel/gpx.cc
gpsbabel/tpo.cc

index dcc878e19f097b70892e1a4583a244f8bdcd419d..68d38813a98fea41995bd178c24fed1b4987cea0 100644 (file)
@@ -1441,7 +1441,7 @@ fprint_xml_chain(xml_tag* tag, const waypoint* wpt)
       if (tag->child) {
         fprint_xml_chain(tag->child, wpt);
       }
-      if (wpt && wpt->gc_data->exported &&
+      if (wpt && wpt->gc_data->exported.isValid() &&
           strcmp(tag->tagname, "groundspeak:cache") == 0) {
           writer.writeTextElement("time", 
                                   wpt->gc_data->exported.toPrettyString());
index a3638f0bf4c845881e14470e97e31c4b1eb1f053..e5f366cb238f13c5b8bcdf0b29f72bcdda60a3c5 100644 (file)
@@ -556,7 +556,8 @@ void tpo_process_tracks(void)
   }
   char style_name[track_style_count][TRACKNAMELENGTH]; // some huge value
   int style_color[track_style_count][3];  // keep R/G/B values separate because line_color needs BGR
-  int style_wide[track_style_count],style_dash[track_style_count];
+  int style_wide[track_style_count];
+  int *style_dash = (int*) xcalloc(sizeof(int), track_style_count);
   for (ii = 0; ii < track_style_count; ii++) {
 
     // clumsy way to skip two undefined bytes